<template>
    <span id="Switch" @click="clicked = !clicked">
        <label>Open</label><span :style="{marginLeft: clicked ? '-40px' : '0px'}" id="Button"></span><label>Close</label>
    </span>
</template>

<script>
export default {
    data: () => {
        return {
            clicked: false
        }
    },
    methods: {

    }
}
</script>

<style lang="scss" scoped>

$color: orange;
$width: 80px;
$height: 25px;

* {
    margin: 0px;
    padding: 0px;
    transition: all 0.5s;
    font-size: 14px;
}

#Switch {
    // overflow: hidden;
    display: inline-block;
    background-color: $color;
    width: $width;
    height: $height;
}
#Button {
    display: inline-block;
    height: 100%;
    background-color: red;
    width: 25px;
}
</style>
